import { uiProperties, uiStyleProperties, enumProperties } from './common'

// cascader
export const cascaderProperties = [
    ...uiProperties.filter(e => ['ui.placeholder', 'ui.clearable'].indexOf(e.model) !== -1),
    ...uiStyleProperties.filter(e => ['ui.style.width'].indexOf(e.model) !== -1),
    ...enumProperties.filter(e => ['enum'].indexOf(e.model) !== -1),
    {
        model: 'ui.showAllLevels',
        widget: 'switch',
        label: '显示完整路径'
    },
    {
        model: 'ui.filterable',
        widget: 'switch',
        label: '可搜索'
    },
    {
        model: 'ui.separator',
        widget: 'input',
        label: '选项分隔符',
        ui: {
            placeholder: '默认为 / '
        }
    },
    {
        model: 'ui.props.multiple',
        widget: 'switch',
        label: '是否多选'
    },
    {
        model: 'ui.collapseTags',
        widget: 'switch',
        label: '多选时折叠Tag',
        if (model) {
            return model && model.ui && model.ui.props && model.ui.props.multiple
        }
    },
    {
        model: 'ui.props.checkStrictly',
        widget: 'switch',
        label: '父子不关联',
        if (model) {
            return model && model.ui && model.ui.props && model.ui.props.multiple
        }
    },
    {
        model: 'ui.props.expandTrigger',
        widget: 'radioButton',
        label: '展开方式',
        enum: [
            { label: 'click', value: '点击' },
            { label: 'hover', value: 'hover' }
        ]
    }
]
